import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Routes } from '@angular/router';
import { AccountsComponent } from './accounts/accounts.component';
import { UsersComponent } from './users/users.component';
import { IpLoginComponent } from './ip-login/ip-login.component';
import { TableModule } from '../../shared/components/table/table.module';
import { PipesModule } from '../../shared/pipes/pipes.module';
import { FormsModule } from '@angular/forms';
import { AccountComponent } from './accounts/account/account.component';
import { SweetAlert2Module } from '@toverux/ngx-sweetalert2';
import { ToasterModule } from 'angular2-toaster';
import { UserComponent } from './users/user/user.component';
import { IpListComponent } from './ip-login/ipList/ipList.component';

const routes: Routes = [
  {
    path: 'accounts',
    component: AccountsComponent
  },
  {
    path: 'accounts/:id',
    component: AccountComponent
  },
  {
    path: 'users/:id',
    component: UserComponent
  },
  {
    path: 'accounts/:id',
    component: AccountComponent
  },
  {
    path: 'users',
    component: UsersComponent
  }, 
  {
    path: 'users/:id',
    component: UserComponent
  },
  {
    path: 'iplogin',
    component: IpLoginComponent
  },
  {
    path: 'iplogin/:id/:name',
    component: IpListComponent
  }
];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    TableModule,
    PipesModule,
    RouterModule.forChild(routes),
    SweetAlert2Module,    
    ToasterModule.forRoot()
  ],
  declarations: [
    AccountsComponent,
    AccountComponent,
    UsersComponent,
    UserComponent,
    IpLoginComponent,
    IpListComponent
  ]
})
export class UserManagementModule { }
